<caltech-header title="ADVANCED EXPENSES">
    <h3 class="hidden-print">PHIẾU ĐỀ XUẤT CHI (ADVANCED EXPENSES)</h3>
    <h4 class="visible-print">Phiếu đề xuất chi</h4>
    <h4 class="visible-print">(Advanced Expenses)</h4>
</caltech-header>

<div class="page-ae-item">
    <div class="row component">
        <div class="col-xs-6">
            <div class="company-info">
                <strong>CTCP Giám Định Kim Long</strong>
                <div><small>86 Xuân Thủy, P.Thảo Điền, Q2, TP-HCM</small></div>
                <div><small>Tel: (8)6281.8497 - Fax: (8)6281-8481</small></div>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="row">
                <div class="col-xs-2">
                    <label>AE #:</label>
                </div>
                <div class="col-xs-10">
                    <a href="#" editable-select="model.aeNo" e-ng-options="region.value as region.text for region in regions" buttons="no" blur="submit" onaftersave="">{{model.aeNo + model.aeNoView}}</a>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-2">
                    <label>AE Date:</label>
                </div>
                <div class="col-xs-10">
                    <a href="#" e-datepicker-popup="dd/MMM/yyyy" e-class="form-control" editable-bsdate="model.aeDate" buttons="no" blur="submit">{{model.aeDate | date : 'dd/MM/yyyy'}}</a>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-2">
                    <label>For PO#:</label>
                </div>
                <div class="col-xs-10">
                    <a href="#" editable-text="model.poNo" buttons="no" blur="submit" e-name="poNo">{{model.poNo}}</a>
                </div>
            </div>
        </div>
    </div>
    <div class="component">
        <div class="row">
            <div class="col-xs-7">
                <div class="row">
                    <div class="col-xs-4">
                        <label class="hidden-print">
                            Tên Khách Hàng:
                        </label>
                        <label class="visible-print">Tên Khách Hàng:</label>
                    </div>
                    <div class="col-xs-8">
                        <a href="#" class="editable-wrap" e-typeahead="customer as customer.name for customer in getCustomerList($viewValue)" e-typeahead-editable="false"
                           onaftersave="updateCustomer($data)" editable-text="model.company.name" buttons="no" blur="submit"><strong>{{model.company.name}}</strong></a>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <label>Địa chỉ:</label>
                    </div>
                    <div class="col-xs-8">
                        <span>{{model.company.address}} {{model.company.city}} {{model.company.state}} {{model.company.country}}</span>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-4">
                        <label>Số tiền viết chữ:</label>
                    </div>
                    <div class="col-xs-8">
                        <a href="#" editable-text="model.totalMoney" buttons="no" blur="submit" e-name="totalMoney" class="hidden-print">{{model.totalMoney}}</a>
                        <label class="visible-print" style="font-weight:normal">{{model.totalMoney}}</label>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-4">
                        <label>Lý do:</label>
                    </div>
                    <div class="col-xs-8">
                        <a href="#" editable-select="selectedReason" e-ng-options="reason as reason.text for reason in reasons track by reason.value" buttons="no" blur="submit" onaftersave="">{{selectedReason.text}}</a>
                    </div>
                </div>
            </div>
            <div class="col-xs-5 left-panel">
                <div class="row">
                    <div class="col-xs-4">
                        <label>Người đề xuất:</label>
                    </div>
                    <div class="col-xs-8 left-item">
                        <label>{{model.user.fullName}}</label>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <label>Department:</label>
                    </div>
                    <div class="col-xs-8 left-item">
                        <label>{{model.user.roleName}}</label>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <label>Số tiền VNĐ:</label>
                    </div>
                    <div class="col-xs-8 left-item">
                        <a href="#" editable-text="model.total" buttons="no" blur="submit" e-name="total">{{model.total |number}}</a>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <label>Ngày chi tiền:</label>
                    </div>
                    <div class="col-xs-8 left-item">
                        <a href="#" e-datepicker-popup="dd/MMM/yyyy" e-class="form-control" editable-bsdate="model.paymentDate" buttons="no" blur="submit">{{model.paymentDate | date: 'dd/MM/yyyy'}}</a>
                    </div>
                </div>

            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <label>Ghi chú:</label>
            </div>
            <div class="col-md-12 hidden-print">
                <a href="#" editable-textarea="model.note" e-rows="7" buttons="no" blur="submit" style="height: auto">
                    <pre>{{ model.note }}</pre>
                </a>
            </div>
            <div class="col-md-12 visible-print">
                <div class="pre">{{model.note}}</div>
            </div>
        </div>
    </div>
    <div class="row signature-top">
        <div class="col-xs-1 text-center">
            <label>Người đề xuất</label>
        </div>
        <div class="col-xs-2 text-center area">
            <label>Trưởng BP(Manager)</label>
        </div>
        <div class="col-xs-2 text-center">
            <label>Kế toán</label>
        </div>
        <div class="col-xs-3 text-center">
            <label>Kế toán trưởng</label>
        </div>
        <div class="col-xs-2 text-center">
            <label>BGĐ phê duyệt</label>
        </div>
    </div>
    <div class="row signature">
        <div class="col-xs-1 text-center">
            <br/>
            <label>{{model.user.fullName}}</label>
        </div>
        <div class="col-xs-2 text-center area">
            <input type="checkbox" ng-model="roles.leader" ng-change="change(1)" class="hidden-print" has-access="AEManager"> <br />
            <label>{{model.leader.fullName}}</label>
        </div>
        <div class="col-xs-2 text-center">
            <input type="checkbox" ng-model="roles.accounting" ng-change="change(2)" class="hidden-print" has-access="AEKToan"> <br />
            <label>{{model.accounting.fullName}}</label>
        </div>
        <div class="col-xs-3 text-center">
            <input type="checkbox" ng-model="roles.accountingManager" ng-change="change(3)" class="hidden-print" has-access="AEKTTruong"> <br />
            <label>{{model.accountingManager.fullName}}</label>
        </div>
        <div class="col-xs-2 text-center">
            <input type="checkbox" ng-model="roles.manager" ng-change="change(4)" class="hidden-print" has-access="AEBGD"> <br />
            <label>{{model.manager.fullName}}</label>
        </div>
    </div>
</div>
<nav class="navbar navbar-default navbar-fixed-bottom navbar-inverse" role="navigation">
    <div class="container">
        <button class="btn btn-warning navbar-btn" ng-click="back()">Back</button>
        <button class="btn btn-warning navbar-btn pull-right" busy-click="remove(model)" success="Deleted successfully" has-access="AEDelete" ng-show="model.id">Delete</button>
        <button class="btn btn-info navbar-btn" ng-show="model.id" ng-click="copy()" has-access="AECreate">Copy</button>
        <button class="btn btn-info navbar-btn" ng-show="model.id" busy-click="update(model)" has-access="AEEdit" success="Updated successfully">Update</button>
        <button class="btn btn-info navbar-btn" ng-hide="model.id" busy-click="save(model)" has-access="AECreate" success="Created successfully">Save</button>
        <button class="btn btn-info navbar-btn" ng-show="model.id" ng-click="doPrint()"><i class="glyphicon glyphicon-print"></i> Print</button>
    </div>
</nav>
